'use strict';

/**
 * @param {Egg.Application} app - egg application
 */

const fs = require('fs');
module.exports = app => {
  // pc 端
  fs.readdirSync(`${__dirname}/routes/admin`).map(val =>
    require('./routes/admin/' + val)(app)
  );

  // 小程序端
  fs.readdirSync(`${__dirname}/routes/mina`).map(val =>
    require('./routes/mina/' + val)(app)
  );

  fs.readdirSync(`${__dirname}/routes/common`).map(val =>
    require('./routes/common/' + val)(app)
  );
};
